package com.ieasy.module.system.web.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ieasy.basic.model.DataGrid;
import com.ieasy.basic.model.Msg;
import com.ieasy.basic.util.cons.Const;
import com.ieasy.module.common.web.action.BaseController;
import com.ieasy.module.system.service.IDeptInfoItemService;
import com.ieasy.module.system.web.form.DeptInfoItemForm;

@Controller
@RequestMapping("/admin/system/deptinfo_item")
public class DeptInfoItemAction extends BaseController {

	@Autowired
	private IDeptInfoItemService deptinfoItemService ;
	
	@RequestMapping("/deptinfo_item_main_UI.do")
	public String deptinfo_item_main_UI(){
		return  Const.SYSTEM + "deptinfo_item_main_UI" ;
	}
	
	@RequestMapping("/deptinfo_item_form_UI.do")
	public String deptinfo_item_form_UI(DeptInfoItemForm form, Model mode){
		if(null != form.getId() && !"".equals(form.getId())) {
			mode.addAttribute("id", form.getId()) ;
		}
		return Const.SYSTEM + "deptinfo_item_form_UI" ;
	}
	
	@RequestMapping("/deptinfo_m_item_main_UI.do")
	public String deptinfo_m_item_main_UI(){
		return  Const.SYSTEM + "deptinfo_m_item_main_UI" ;
	}
	
	@RequestMapping("/deptinfo_m_item_form_UI.do")
	public String deptinfo_m_item_form_UI(DeptInfoItemForm form, Model mode){
		if(null != form.getId() && !"".equals(form.getId())) {
			mode.addAttribute("id", form.getId()) ;
		}
		return Const.SYSTEM + "deptinfo_m_item_form_UI" ;
	}
	
	@RequestMapping("/deptinfo_open_UI.do")
	public String deptinfo_open_UI(DeptInfoItemForm form, Model mode){
		if(null != form.getId() && !"".equals(form.getId())) {
			mode.addAttribute("id", form.getId()) ;
		}
		return  Const.SYSTEM + "deptinfo_open_UI" ;
	}
	
	@RequestMapping("/deptinfo_view_by_category_UI.do")
	public String deptinfo_view_by_category_UI(DeptInfoItemForm form, Model mode){
		if(null != form.getId() && !"".equals(form.getId())) {
			mode.addAttribute("id", form.getId()) ;
		}
		return  Const.SYSTEM + "deptinfo_view_by_category_UI" ;
	}
	
	@RequestMapping("/deptinfo_view_by_category_root_UI.do")
	public String deptinfo_view_by_category_root_UI(DeptInfoItemForm form, Model mode){
		if(null != form.getId() && !"".equals(form.getId())) {
			mode.addAttribute("id", form.getId()) ;
		}
		return  Const.SYSTEM + "deptinfo_view_by_category_root_UI" ;
	}
	@RequestMapping("/deptinfo_item_add_UI.do")
	public String deptinfo_item_add_UI(DeptInfoItemForm form, Model mode){
		if(null != form.getCategoryId() && !"".equals(form.getCategoryId())) {
			mode.addAttribute("categoryId", form.getCategoryId()) ;
		}
		return Const.SYSTEM + "deptinfo_item_add_UI" ;
	}
	
	@RequestMapping("/deptinfo_item_update_UI.do")
	public String deptinfo_item_update_UI(DeptInfoItemForm form, Model mode){
		if(null != form.getId() && !"".equals(form.getId())) {
			mode.addAttribute("id", form.getId()) ;
		}
		return Const.SYSTEM + "deptinfo_item_update_UI" ;
	}
	
	
	@RequestMapping("/get.do")
	@ResponseBody
	public DeptInfoItemForm get(DeptInfoItemForm form){
		return this.deptinfoItemService.get(form) ;
	}
	
	@RequestMapping("/add.do")
	@ResponseBody
	public Msg add(DeptInfoItemForm form){
		return this.deptinfoItemService.add(form) ;
	}
	
	@RequestMapping("/update.do")
	@ResponseBody
	public Msg edit(DeptInfoItemForm form){
		return this.deptinfoItemService.update(form) ;
	}
	
	@RequestMapping("/delete.do")
	@ResponseBody
	public Msg delete(DeptInfoItemForm form){
		return this.deptinfoItemService.delete(form) ;
	}
	
	@RequestMapping("/datagrid.do")
	@ResponseBody
	public DataGrid datagrid(DeptInfoItemForm form){
		return this.deptinfoItemService.datagrid(form) ;
	}
	
	@RequestMapping("/view_datagrid.do")
	@ResponseBody
	public DataGrid view_datagrid(DeptInfoItemForm form){
		return this.deptinfoItemService.datagrid(form) ;
	}
	
}
